package org.springframework.beans.factory.config;

import org.springframework.beans.BeansException;

/**
 * @author xiaohei
 */
public interface BeanPostProcessor {

    /**
     * 前置处理
     *
     * @param beanName
     * @param bean
     * @return
     * @throws BeansException
     */
    default Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        return null;
    }

    /**
     * 后置处理
     *
     * @param beanName
     * @param bean
     * @return
     * @throws BeansException
     */
    default Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }
}
